from django import forms

from cmdb.models import *


class IDCLevelForm(forms.ModelForm):
    class Meta:
        model = IDCLevel
        fields = ['name', 'comment']


class ISPForm(forms.ModelForm):
    class Meta:
        model = ISP
        fields = ['name']


class IDCForm(forms.ModelForm):
    class Meta:
        model = IDC
        fields = ['name', 'operator', 'bandwidth', 'phone', 'linkman',
                  'address', 'concat_email', 'network',
                  'type', 'comment']


class CabinetForm(forms.ModelForm):
    class Meta:
        model = Cabinet
        fields = ['idc', 'name']


class RackForm(forms.ModelForm):
    class Meta:
        model = Rack
        fields = ['idc', 'cabinet', 'name']


class HostGroupForm(forms.ModelForm):
    class Meta:
        model = HostGroup
        fields = ['parent', 'name']


class HostForm(forms.ModelForm):
    class Meta:
        model = Host
        fields = ['host_group', 'host', 'host_name', 'kernel', 'kernel_release',
                  'virtual', 'osrelease', 'saltversion', 'osfinger',
                  'os_family', 'num_gpus', 'system_serialnumber',
                  'cpu_model', 'productname', 'osarch', 'cpuarch',
                  'os', 'mem_total', 'num_cpus', 'idc', 'cabinet',
                  'rack', 'minion_status', 'enable_ssh', 'ssh_username',
                  'ssh_password', 'enable_sudo'
                  ]
